package cn.secby.wms.util;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@NoArgsConstructor
public class PlacePoint implements Comparable<PlacePoint>{
    private double x,y,len;

    public PlacePoint(double x, double y, double len) {
        this.x = x;
        this.y = y;
        this.len = len;
    }

    public PlacePoint(double x, double y) {
        this.x = x;
        this.y = y;
    }

    @Override
    public int compareTo(PlacePoint o) {
        // 优先往下排 然后优先往左排
        int compare_y = Double.compare(y,o.y );
        if(compare_y!=0){
            return compare_y;
        }else{
            return Double.compare(x,o.x);
        }
    }
}